package com.example.front.test;

/**
 * Proxy
 *
 * @author liming2
 * @date 2023/11/1 11:13
 */
public class Proxy {

    public static class Foo {

        public void f1() {
            System.out.println("f1-origin");
            this.f2();
        }

        public void f2() {
            System.out.println("f2-origin");
        }
    }

    public static class Bar extends Foo {

        @Override
        public void f1() {
            System.out.println("f1-extend");
            super.f1();
        }

        @Override
        public void f2() {
            System.out.println("f2-extend");
            super.f2();
        }
    }

    public static void main(String[] args) {
        Foo f = new Bar();
        f.f1();
    }
}
